package www.core.com.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import www.core.com.dao.BaseDAO;
import www.core.com.pojo.BaseCode;
import www.core.com.pojo.User;

@Service
public  class AbstractService<T> extends BaseService  {
	
	@Resource(name = "hibernateDAO")
	BaseDAO<T> hibernateDAO;
	
	public BaseDAO<T> getHibernateDAO() {
		return hibernateDAO;
	}

	public void setHibernateDAO(BaseDAO<T> hibernateDAO) {
		this.hibernateDAO = hibernateDAO;
	}

	
	public List getAll(Class T) {
		// TODO Auto-generated method stub
		return hibernateDAO.getAll(T);
	}

	
	public T findByColumn(Class T, String column, String value) {
		// TODO Auto-generated method stub
		return hibernateDAO.findByColumn(T, column, value);
	}

	
	
	public void save(T... entity) {
		// TODO Auto-generated method stub
		hibernateDAO.save(entity);
	}

	
	public void saveOrUpdate(T... entity) {
		// TODO Auto-generated method stub
		hibernateDAO.saveOrUpdate(entity);
	}

	
	public List<T> getList(T t) {
		// TODO Auto-generated method stub
		return null;
	}

	public List getListByPage(String sql, Map<String, String> map, int start,
			int row) {
		// TODO Auto-generated method stub
		return null;
	}

	public Long count(String sql, Map<String, String> map) {
		// TODO Auto-generated method stub
		return null;
	}	
	public T findByColumn(String hql, Map<String, String> parm) {
		// TODO Auto-generated method stub
		return null;
	}

	
	public void delete(T... entity) {
		// TODO Auto-generated method stub
		
	}

	
	public void delete(T entity) {
		// TODO Auto-generated method stub
		
	}

	
	public int executeUpdate(String hql) {
		// TODO Auto-generated method stub
		return 0;
	}



}
